<?php include "../public/header.php";?>
<?php include "../public/header_show.php";?>
<style>
    .tt{width: 15%!important;}
    .tv{width: 35%!important;}
</style>
<body id="xiangqingPage">
<div id="xiangqingBox" style="padding-bottom: 200px">
    <div class="page-title">
        <div class="page-title-con">
            <span class="pageshowtitle">详情</span>
            <div class="page-title-opt-list">
                <span id="page-close" class="page-close" onclick="layer_close()">×</span>
            </div>
        </div>
    </div>
    <div class="main-container">
        <div class="table-box tablenes">
            <div class="title">工程负责人信息</div>
            <table class="layui-table">
                <tbody>
                <tr><td class="tt">工程负责人</td><td class="tv" id="gofuer"></td><td class="tt">负责人联系电话</td><td class="tv" id="gofutel"></td></tr>
                </tbody>
            </table>
        </div>

        <div class="table-box tablenes">
            <div class="title">资金总览</div>
            <table class="layui-table">
                <tbody>
                <tr><td class="tt">工程回款余额合计(元)</td><td class="tv" id="hougonghuikeyong"></td><td class="tt">预收款余额(元)</td><td class="tv" id="hougongyukeyong"></td></tr>
                <tr><td class="tt">余额总计(元)</td><td class="tv" id="allkeyong"></td><td class="tt">待还借款合计(元)</td><td class="tv" id="daihuanjiefee"></td></tr>
                </tbody>
            </table>
        </div>


        <div class="table-box tablenes">
            <script type="text/html" id="toolbarDemo_list_gonghui">
                <span>工程回款资金池</span>
            </script>
            <div class="tableShow">
                <table id="datalist_list_gonghui" lay-filter="datalist_list_gonghui"></table>
            </div>
        </div>

        <div class="table-box tablenes">
            <script type="text/html" id="toolbarDemo_list_gongyu">
                <span>预收款资金池</span>
            </script>
            <div class="tableShow">
                <table id="datalist_list_gongyu" lay-filter="datalist_list_gongyu"></table>
            </div>
        </div>


        <div class="table-box tablenes">
            <script type="text/html" id="toolbarDemo_list_houjie">
                <span>工程负责人借款</span>
            </script>
            <div class="tableShow">
                <table id="datalist_list_houjie" lay-filter="datalist_list_houjie"></table>
            </div>
        </div>

    </div>
</div>
<script>
    var param_gofuer = decodeURI(getQueryVariable('gofuer') || '') || '';

    layui.use(['form', 'layer', "laytp",'element','dropdown','laypage','table','soulTable'], function() {
        var laypage = layui.laypage, table = layui.table, dropdown = layui.dropdown, form = layui.form, soulTable = layui.soulTable,element = layui.element;

        facade.ajax({url: ask_engin_gofuer, data:{gofuer: param_gofuer}}).done(function(res){
            if (res.code === 2000) {
                var data = res.data;

                $("#gofuer").text(data.gofuer);
                $("#gofutel").text(data.gofutel);
                $("#hougonghuikeyong").text(data.hougonghuikeyong);
                $("#hougongyukeyong").text(data.hougongyukeyong);
                $("#allkeyong").text(data.allkeyong);
                $("#daihuanjiefee").text(data.daihuanjiefee);



                var mytableList11 = table.render({
                    elem: "#datalist_list_gonghui",data:res.data.list_gonghui, toolbar: '#toolbarDemo_list_gonghui', page: false
                    ,limit:TabInitShow.limit,soulSort: TabInitShow.soulSort,method: TabInitShow.method, overflow: TabInitShow.overflow
                    ,defaultToolbar: TabInitShow.defaultToolbar,filter: TabInitShow.filter ,text: TabInitShow.text,totalRow: true
                    ,request: TabInitShow.request,response: TabInitShow.response,contextmenu:get_table_contextmenu(soulTable)
                    , cols: [[
                        {type:'numbers',title:'序号',totalRowText: '合计',fixed:'left'}
                        ,{field:'name',title:'工程名称',templet: function(d){
                                return '<span class="colorlan" onclick="openPage(\'../engin/show.php?id='+d.id+'\')">'+d.name+'</span>';
                            }}
                        ,{field:'',title:'施工合同金额(元)',totalRow: true,templet: function(d){
                                if(d.shiinfo){
                                    return '<span class="colorlan" onclick="openPage(\'../contract_shi/show.php?id='+d.shiinfo.id+'\');">'+d.shiinfo.money+'</span>';
                                }else{
                                    return '';
                                }
                            }}
                        ,{field:'',title:'施工合同累计结算金额(元)',totalRow: true,templet: function(d){
                                if(d.shijiemoney){
                                    return '<span class="colorlan" onclick="openNavPage(\'施工合同结算信息\',\'contract_shi_jie/index.php?enginid='+d.id+'\');">'+d.shijiemoney+'</span>';
                                }else{
                                    return '';
                                }
                            }}
                        ,{field:'',title:'累计工程回款A(元)',totalRow: true,templet: function(d){
                                if(d.hougonghuimoney){
                                    return '<span class="colorlan" onclick="openNavPage(\'工程回款信息\',\'hou_gonghui/index.php?enginid='+d.id+'\');">'+d.hougonghuimoney+'</span>';
                                }else{
                                    return '';
                                }
                            }}
                        ,{field:'',title:'累计工程付款B(元)',totalRow: true,templet: function(d){
                                if(d.hougongzhimoneyquben){
                                    return '<span class="colorlan" onclick="openNavPage(\'工程付款明细信息\',\'hou_chi_gongzhi/index.php?status=1&qu_enginid='+d.id+'\');">'+d.hougongzhimoneyquben+'</span>';
                                }else{
                                    return '';
                                }
                            }}
                        ,{field:'',title:'累计已收取(元)C',totalRow: true,templet: function(d){
                                if(d.hougonghuikoufee){
                                    return '<span class="colorlan" onclick="openNavPage(\'工程回款信息\',\'hou_gonghui/index.php?status=1&enginid='+d.id+'\');">'+d.hougonghuikoufee+'</span>';
                                }else{
                                    return '';
                                }
                            }}
                        ,{field:'',title:'其中暂扣合计(元)',totalRow: true,templet: function(d){
                                if(d.qizankoufee){
                                    return '<span class="colorlan" onclick="openNavPage(\'直接扣收明细信息\',\'hou_chi_kou_qifei/index.php?status=1&enginid='+d.id+'&kouxing='+encodeURI('暂扣')+'\');">'+d.qizankoufee+'</span>';
                                }else{
                                    return '';
                                }
                            }}
                        ,{field:'',title:'暂扣解冻合计D(元)',totalRow: true,templet: function(d){
                                if(d.jiedongkoufee){
                                    return '<span class="colorlan" onclick="openNavPage(\'直接收取信息\',\'hou_chi_kou_qifei/index.php?isdong=1&enginid='+d.id+'\');">'+d.jiedongkoufee+'</span>';
                                }else{
                                    return '';
                                }
                            }}
                        ,{field: 'yuliufee', title: '预留金额'}
                        ,{field: 'hougonghuikeyong', title: '工程回款可用余额A-B-C+D(元)',totalRow: true}

                    ]]
                    , done: function (res) {
                        soulTable.render(this);
                    }
                });


                var mytableList22 = table.render({
                    elem: "#datalist_list_gongyu",data:res.data.list_gongyu, toolbar: '#toolbarDemo_list_gongyu', page: false
                    ,limit:TabInitShow.limit,soulSort: TabInitShow.soulSort,method: TabInitShow.method, overflow: TabInitShow.overflow
                    ,defaultToolbar: TabInitShow.defaultToolbar,filter: TabInitShow.filter ,text: TabInitShow.text,totalRow: true
                    ,request: TabInitShow.request,response: TabInitShow.response,contextmenu:get_table_contextmenu(soulTable)
                    , cols: [[
                        {type:'numbers',title:'序号',totalRowText: '合计',fixed:'left'}
                        ,{field: 'gofuer', title: '工程负责人'}
                        ,{field:'',title:'累计预收款(元)A',totalRow: true,templet: function(d){
                                if(d.hougongyumoney){
                                    return '<span class="colorlan" onclick="openNavPage(\'工程负责人预收款信息\',\'hou_gongyu/index.php?status=1&gofuer='+encodeURI(d.gofuer)+'\');">'+d.hougongyumoney+'</span>';
                                }else{
                                    return '';
                                }
                            }}
                        ,{field:'',title:'累计工程付款(元)B',totalRow: true,templet: function(d){
                                if(d.hougongzhimoneyqugoer){
                                    return '<span class="colorlan" onclick="openNavPage(\'工程付款明细信息\',\'hou_chi_gongzhi/index.php?status=1&qutype=1&gofuer='+encodeURI(d.gofuer)+'\');">'+d.hougongzhimoneyqugoer+'</span>';
                                }else{
                                    return '';
                                }
                            }}
                        ,{field:'',title:'累计已收取(元)C',totalRow: true,templet: function(d){
                                if(d.hougongyukoufee){
                                    return '<span class="colorlan" onclick="openNavPage(\'工程负责人预收款信息\',\'hou_gongyu/index.php?status=1&gofuer='+encodeURI(d.gofuer)+'\');">'+d.hougongyukoufee+'</span>';
                                }else{
                                    return '';
                                }
                            }}
                        ,{field:'',title:'其中暂扣合计(元)',totalRow: true,templet: function(d){
                                if(d.qizankoufee){
                                    return '<span class="colorlan" onclick="openNavPage(\'直接扣收明细信息\',\'hou_chi_kou_qifei/index.php?status=1&listtype=2&enginid='+d.id+'&kouxing='+encodeURI('暂扣')+'\');">'+d.qizankoufee+'</span>';
                                }else{
                                    return '';
                                }
                            }}
                        ,{field:'',title:'暂扣解冻合计(元)D',totalRow: true,templet: function(d){
                                if(d.jiedongkoufee){
                                    return '<span class="colorlan" onclick="openNavPage(\'直接扣收明细信息\',\'hou_chi_kou_qifei/index.php?status=1&listtype=2&isdong=1&enginid='+d.id+'&kouxing='+encodeURI('暂扣')+'\');">'+d.jiedongkoufee+'</span>';
                                }else{
                                    return '';
                                }
                            }}
                        ,{field: 'yuliufee', title: '预留金额'}
                        ,{field:'',title:'进项抵扣退税转入(元)E',totalRow: true,templet: function(d){
                                if(d.hougongshuimoneygoquan){
                                    return '<span class="colorlan" onclick="openNavPage(\'进项抵扣退税信息\',\'hou_gongshui/index.php?status=1&tuifang=2&gofuer='+encodeURI(d.gofuer)+'\');">'+d.hougongshuimoneygoquan+'</span>';
                                }else{
                                    return '';
                                }
                            }}
                        ,{field: 'hougongyukeyong', title: '预收款可用余额(元)A-B-C+D+E',totalRow: true}

                    ]]
                    , done: function (res) {
                        soulTable.render(this);
                    }
                });


                var mytableList33 = table.render({
                    elem: "#datalist_list_houjie",data:res.data.list_houjie, toolbar: '#toolbarDemo_list_houjie', page: false
                    ,limit:TabInitShow.limit,soulSort: TabInitShow.soulSort,method: TabInitShow.method, overflow: TabInitShow.overflow
                    ,defaultToolbar: TabInitShow.defaultToolbar,filter: TabInitShow.filter ,text: TabInitShow.text,totalRow: true
                    ,request: TabInitShow.request,response: TabInitShow.response,contextmenu:get_table_contextmenu(soulTable)
                    , cols: [[
                        {type:'numbers',title:'序号',totalRowText: '合计',fixed:'left'}
                        ,{field:'statename',title:'借款状态',templet: function(d){
                                if(d.statename == '未还款'){
                                    return '<span class="colorhong">'+d.statename+'</span>';
                                }else if(d.statename == '已还款'){
                                    return '<span class="colorlv">'+d.statename+'</span>';
                                }else{
                                    return d.statename;
                                }
                            }}
                        ,{field: 'jieer', title: '借款人'}
                        ,{field: 'money', title: '借款金额(元)',totalRow: true}
                        ,{field: 'yuerate', title: '周期利率(%)'}
                        ,{field: 'number', title: '合同编号'}
                        ,{field: 'fangkuandt', title: '放款日期'}
                        ,{field: 'yueshu', title: '借款周期数'}
                        ,{field: 'money', title: '应还本金(元)'}
                        ,{field: 'lixifee', title: '应还利息(元)'}
                        ,{field: 'yinghuanfee', title: '应还合计(元)'}
                        ,{field: 'youfee', title: '利息优惠(元)'}
                        ,{field: 'koufee', title: '还款金额(元)',totalRow: true}
                        ,{field: 'huandt', title: '还款日期'}
                    ]]
                    , done: function (res) {
                        soulTable.render(this);
                    }
                })

                render_from();
            }
        });

    });






</script>
</body>
</html>




